home *** CD-ROM | disk | FTP | other *** search
/ CD BIT 75 / CD BIT 75.iso / Software / mysql-4.0.22-win / data1.cab / Documentation / Docs / INSTALL-BINARY < prev    next >
Encoding:
Text File  |  2004-10-28  |  8.4 KB  |  201 lines

  1. Installing MySQL on Other Unix-Like Systems
  2. -------------------------------------------
  3.  
  4. This section covers the installation of MySQL binary distributions that
  5. are provided for various platforms in the form of compressed `tar' files
  6. (files with a `.tar.gz' extension).  See *Note MySQL binaries:: for a
  7. detailed list.
  8.  
  9. To obtain MySQL, see *Note Getting MySQL::.
  10.  
  11. MySQL `tar' file binary distributions have names of the form
  12. `mysql-VERSION-OS.tar.gz', where `VERSION' is a number (for example,
  13. `4.0.17'), and OS indicates the type of operating system for which the
  14. distribution is intended (for example, `pc-linux-i686').
  15.  
  16. In addition to these generic packages, we also offer binaries in
  17. platform-specific package formats for selected platforms.  See *Note
  18. Quick Standard Installation:: for more information on how to install
  19. these.
  20.  
  21. You need the following tools to install a MySQL `tar' file binary
  22. distribution:
  23.  
  24.    * GNU `gunzip' to uncompress the distribution.
  25.  
  26.    * A reasonable `tar' to unpack the distribution. GNU `tar' is known
  27.      to work. Some operating systems come with a pre-installed version
  28.      of `tar' that is known to have problems.  For example, Mac OS X
  29.      `tar' and Sun `tar' are known to have problems with long
  30.      filenames.  On Mac OS X, you can use the pre-installed `gnutar'
  31.      program.  On other systems with a deficient `tar', you should
  32.      install GNU `tar' first.
  33.  
  34. If you run into problems, _please always use `mysqlbug'_ when posting
  35. questions to a MySQL mailing list.  Even if the problem isn't a bug,
  36. `mysqlbug' gathers system information that will help others solve your
  37. problem.  By not using `mysqlbug', you lessen the likelihood of getting
  38. a solution to your problem.  You will find `mysqlbug' in the `bin'
  39. directory after you unpack the distribution.  *Note Bug reports::.
  40.  
  41. The basic commands you must execute to install and use a MySQL binary
  42. distribution are:
  43.  
  44.      shell> groupadd mysql
  45.      shell> useradd -g mysql mysql
  46.      shell> cd /usr/local
  47.      shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf -
  48.      shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
  49.      shell> cd mysql
  50.      shell> scripts/mysql_install_db --user=mysql
  51.      shell> chown -R root  .
  52.      shell> chown -R mysql data
  53.      shell> chgrp -R mysql .
  54.      shell> bin/mysqld_safe --user=mysql &
  55.  
  56. For versions of MySQL older than 4.0, substitute `bin/safe_mysqld' for
  57. `bin/mysqld_safe' in the final command.
  58.  
  59. *Note*: This procedure does not set up any passwords for MySQL
  60. accounts.  After following the procedure, proceed to *Note
  61. Post-installation::.
  62.  
  63. A more detailed version of the preceding description for installing a
  64. binary distribution follows:
  65.  
  66.   1. Add a login user and group for `mysqld' to run as:
  67.  
  68.           shell> groupadd mysql
  69.           shell> useradd -g mysql mysql
  70.  
  71.      These commands add the `mysql' group and the `mysql' user.  The
  72.      syntax for `useradd' and `groupadd' may differ slightly on
  73.      different versions of Unix.  They may also be called `adduser' and
  74.      `addgroup'.
  75.  
  76.      You might want to call the user and group something else instead
  77.      of `mysql'.  If so, substitute the appropriate name in the
  78.      following steps.
  79.  
  80.   2. Pick the directory under which you want to unpack the
  81.      distribution, and change location into it. In the following
  82.      example, we unpack the distribution under `/usr/local'. (The
  83.      instructions, therefore, assume that you have permission to create
  84.      files and directories in `/usr/local'.  If that directory is
  85.      protected, you will need to perform the installation as `root'.)
  86.  
  87.           shell> cd /usr/local
  88.  
  89.   3. Obtain a distribution file from one of the sites listed in *Note
  90.      Getting MySQL: Getting MySQL.  For a given release, binary
  91.      distributions for all platforms are built from the same MySQL
  92.      source distribution.
  93.  
  94.   4. Unpack the distribution, which will create the installation
  95.      directory.  Then create a symbolic link to that directory:
  96.  
  97.           shell> gunzip < /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf -
  98.           shell> ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql
  99.  
  100.      The `tar' command creates a directory named `mysql-VERSION-OS'.
  101.      The `ln' command makes a symbolic link to that directory.  This
  102.      lets you refer more easily to the installation directory as
  103.      `/usr/local/mysql'.
  104.  
  105.      With GNU `tar', no separate invocation of `gunzip' is necessary.
  106.      You can replace the first line with the following alternative
  107.      command to uncompress and extract the distribution:
  108.  
  109.           shell> tar zxvf /PATH/TO/MYSQL-VERSION-OS.tar.gz
  110.  
  111.   5. Change location into the installation directory:
  112.  
  113.           shell> cd mysql
  114.  
  115.      You will find several files and subdirectories in the `mysql'
  116.      directory.  The most important for installation purposes are the
  117.      `bin' and `scripts' subdirectories.
  118.  
  119.     `bin'
  120.           This directory contains client programs and the server.  You
  121.           should add the full pathname of this directory to your `PATH'
  122.           environment variable so that your shell finds the MySQL
  123.           programs properly. *Note Environment variables::.
  124.  
  125.     `scripts'
  126.           This directory contains the `mysql_install_db' script used to
  127.           initialize the `mysql' database containing the grant tables
  128.           that store the server access permissions.
  129.  
  130.   6. If you haven't installed MySQL before, you must create the MySQL
  131.      grant tables:
  132.  
  133.           shell> scripts/mysql_install_db --user=mysql
  134.  
  135.      If you run the command as `root', you should use the `--user'
  136.      option as shown.  The value of the option should be the name of
  137.      the login account that you created in the first step to use for
  138.      running the server.  If you run the command while logged in as
  139.      that user, you can omit the `--user' option.
  140.  
  141.      Note that for MySQL versions older than 3.22.10,
  142.      `mysql_install_db' left the server running after creating the grant
  143.      tables.  This is no longer true; you will need to restart the
  144.      server after performing the remaining steps in this procedure.
  145.  
  146.   7. Change the ownership of program binaries to `root' and ownership
  147.      of the data directory to the user that you will run `mysqld' as.
  148.      Assuming that you are located in the installation directory
  149.      (`/usr/local/mysql'), the commands look like this:
  150.  
  151.           shell> chown -R root  .
  152.           shell> chown -R mysql data
  153.           shell> chgrp -R mysql .
  154.  
  155.      The first command changes the owner attribute of the files to the
  156.      `root' user. The second changes the owner attribute of the data
  157.      directory to the `mysql' user. The third changes the group
  158.      attribute to the `mysql' group.
  159.  
  160.   8. If you would like MySQL to start automatically when you boot your
  161.      machine, you can copy `support-files/mysql.server' to the location
  162.      where your system has its startup files.  More information can be
  163.      found in the `support-files/mysql.server' script itself and in
  164.      *Note Automatic start::.
  165.  
  166.   9. You can set up new accounts using the `bin/mysql_setpermission'
  167.      script if you install the `DBI' and `DBD::mysql' Perl modules.
  168.      For instructions, see *Note Perl support::.
  169.  
  170.  10. If you would like to use `mysqlaccess' and have the MySQL
  171.      distribution in some non-standard place, you must change the
  172.      location where `mysqlaccess' expects to find the `mysql' client.
  173.      Edit the `bin/mysqlaccess' script at approximately line 18.
  174.      Search for a line that looks like this:
  175.  
  176.           $MYSQL     = '/usr/local/bin/mysql';    # path to mysql executable
  177.  
  178.      Change the path to reflect the location where `mysql' actually is
  179.      stored on your system.  If you do not do this, you will get a
  180.      `Broken pipe' error when you run `mysqlaccess'.
  181.  
  182.  
  183. After everything has been unpacked and installed, you should test your
  184. distribution.
  185.  
  186. You can start the MySQL server with the following command:
  187.  
  188.      shell> bin/mysqld_safe --user=mysql &
  189.  
  190. For versions of MySQL older than 4.0, substitute `bin/safe_mysqld' for
  191. `bin/mysqld_safe' in the command.
  192.  
  193. More information about `mysqld_safe' is given in *Note `mysqld_safe':
  194. mysqld_safe.
  195.  
  196. *Note*: The accounts that are listed in the MySQL grant tables
  197. initially have no passwords.  After starting the server, you should set
  198. up passwords for them using the instructions in *Note
  199. Post-installation::.
  200.  
  201.